#include "gtkmarshalers.h"
#include "gtkmenuitem.h"
#include "gtkmountoperation.h"
-#include "gtkplacessidebar.h"
#include "gtkscrolledwindow.h"
#include "gtkseparatormenuitem.h"
#include "gtksettings.h"
#include "gtkprivate.h"
/**
- * SECTION:gtkplacessidebar
- * @Short_description: Sidebar that displays frequently-used places in the file system
- * @Title: GtkPlacesSidebar
- * @See_also: #GtkFileChooser
- *
* #GtkPlacesSidebar is a widget that displays a list of frequently-used places in the
* file system: the user’s home directory, the user’s bookmarks, and volumes and drives.
* This widget is used as a sidebar in #GtkFileChooser and may be used by file managers
gobject_class->set_property = gtk_places_sidebar_set_property;
gobject_class->get_property = gtk_places_sidebar_get_property;
- /**
+ /*
* GtkPlacesSidebar::open-location:
* @sidebar: the object which received the signal.
* @location: (type Gio.File): #GFile to which the caller should switch.
* in it. The calling application should display the contents of that
* location; for example, a file manager should show a list of files in
* the specified location.
- *
- * Since: 3.10
*/
places_sidebar_signals [OPEN_LOCATION] =
g_signal_new (I_("open-location"),
G_TYPE_OBJECT,
GTK_TYPE_PLACES_OPEN_FLAGS);
- /**
+ /*
* GtkPlacesSidebar::populate-popup:
* @sidebar: the object which received the signal.
* @container: (type Gtk.Widget): a #GtkMenu or another #GtkContainer
* #GtkEntries, #GtkSpinButtons, etc. If your application can deal with this
* situation, you can set #GtkPlacesSidebar::populate-all to %TRUE to request
* that this signal is emitted for populating popovers as well.
- *
- * Since: 3.10
*/
places_sidebar_signals [POPULATE_POPUP] =
g_signal_new (I_("populate-popup"),
G_TYPE_FILE,
G_TYPE_VOLUME);
- /**
+ /*
* GtkPlacesSidebar::show-error-message:
* @sidebar: the object which received the signal.
* @primary: primary message with a summary of the error to show.
* application to present an error message. Most of these messages
* refer to mounting or unmounting media, for example, when a drive
* cannot be started for some reason.
- *
- * Since: 3.10
*/
places_sidebar_signals [SHOW_ERROR_MESSAGE] =
g_signal_new (I_("show-error-message"),
G_TYPE_STRING,
G_TYPE_STRING);
- /**
+ /*
* GtkPlacesSidebar::show-enter-location:
* @sidebar: the object which received the signal.
*
* application to present an way to directly enter a location.
* For example, the application may bring up a dialog box asking for
* a URL like "http://http.example.com".
- *
- * Since: 3.14
*/
places_sidebar_signals [SHOW_ENTER_LOCATION] =
g_signal_new (I_("show-enter-location"),
NULL,
G_TYPE_NONE, 0);
- /**
+ /*
* GtkPlacesSidebar::drag-action-requested:
* @sidebar: the object which received the signal.
* @context: (type Gdk.DragContext): #GdkDragContext with information about the drag operation
* Returns: The drag action to use, for example, #GDK_ACTION_COPY
* or #GDK_ACTION_MOVE, or 0 if no action is allowed here (i.e. drops
* are not allowed in the specified @dest_file).
- *
- * Since: 3.10
*/
places_sidebar_signals [DRAG_ACTION_REQUESTED] =
g_signal_new (I_("drag-action-requested"),
G_TYPE_OBJECT,
G_TYPE_POINTER /* GList of GFile */ );
- /**
+ /*
* GtkPlacesSidebar::drag-action-ask:
* @sidebar: the object which received the signal.
* @actions: Possible drag actions that need to be asked for.
*
* Returns: the final drag action that the sidebar should pass to the drag side
* of the drag-and-drop operation.
- *
- * Since: 3.10
*/
places_sidebar_signals [DRAG_ACTION_ASK] =
g_signal_new (I_("drag-action-ask"),
G_TYPE_INT, 1,
G_TYPE_INT);
- /**
+ /*
* GtkPlacesSidebar::drag-perform-drop:
* @sidebar: the object which received the signal.
* @dest_file: (type Gio.File): Destination #GFile.
* destination. This item is in the @dest_file, and the
* @source_file_list has the list of files that are dropped into it and
* which should be copied/moved/etc. based on the specified @action.
- *
- * Since: 3.10
*/
places_sidebar_signals [DRAG_PERFORM_DROP] =
g_signal_new (I_("drag-perform-drop"),
G_TYPE_POINTER, /* GList of GFile */
G_TYPE_INT);
- /**
+ /*
* GtkPlacesSidebar::show-other-locations-with-flags:
* @sidebar: the object which received the signal.
* @open_flags: a single value from #GtkPlacesOpenFlags specifying how it should be opened.
* and network access points.
* For example, the application may bring up a page showing persistent
* volumes and discovered network addresses.
- *
- * Since: 3.20
*/
places_sidebar_signals [SHOW_OTHER_LOCATIONS_WITH_FLAGS] =
g_signal_new (I_("show-other-locations-with-flags"),
G_TYPE_NONE, 1,
GTK_TYPE_PLACES_OPEN_FLAGS);
- /**
+ /*
* GtkPlacesSidebar::mount:
* @sidebar: the object which received the signal.
* @mount_operation: the #GMountOperation that is going to start.
* because the user clicked on some location that needs mounting.
* In this way the application using the #GtkPlacesSidebar can track the
* progress of the operation and, for example, show a notification.
- *
- * Since: 3.20
*/
places_sidebar_signals [MOUNT] =
g_signal_new (I_("mount"),
G_TYPE_NONE,
1,
G_TYPE_MOUNT_OPERATION);
- /**
+ /*
* GtkPlacesSidebar::unmount:
* @sidebar: the object which received the signal.
* @mount_operation: the #GMountOperation that is going to start.
* because the user for example ejected some drive or unmounted a mount.
* In this way the application using the #GtkPlacesSidebar can track the
* progress of the operation and, for example, show a notification.
- *
- * Since: 3.20
*/
places_sidebar_signals [UNMOUNT] =
g_signal_new (I_("unmount"),
1,
G_TYPE_MOUNT_OPERATION);
- /**
+ /*
* GtkPlacesSidebar::show-starred-location:
* @sidebar: the object which received the signal
* @flags: the flags for the operation
* application to present a way to show the starred files. In GNOME,
* starred files are implemented by setting the nao:predefined-tag-favorite
* tag in the tracker database.
- *
- * Since: 3.22.26
*/
places_sidebar_signals [SHOW_STARRED_LOCATION] =
g_signal_new (I_("show-starred-location"),
GTK_PARAM_READWRITE);
- /**
+ /*
* GtkPlacesSidebar:populate-all:
*
* If :populate-all is %TRUE, the #GtkPlacesSidebar::populate-popup signal
* is also emitted for popovers.
- *
- * Since: 3.18
*/
properties[PROP_POPULATE_ALL] =
g_param_spec_boolean (I_("populate-all"),
gtk_widget_class_set_css_name (widget_class, I_("placessidebar"));
}
-/**
+/*
* gtk_places_sidebar_new:
*
* Creates a new #GtkPlacesSidebar widget.
* when the user makes a selection in the sidebar.
*
* Returns: a newly created #GtkPlacesSidebar
- *
- * Since: 3.10
*/
GtkWidget *
gtk_places_sidebar_new (void)
return GTK_WIDGET (g_object_new (gtk_places_sidebar_get_type (), NULL));
}
-/* Public methods for GtkPlacesSidebar */
-
-/**
+/*
* gtk_places_sidebar_set_open_flags:
* @sidebar: a places sidebar
* @flags: Bitmask of modes in which the calling application can open locations
*
* Passing 0 for @flags will cause #GTK_PLACES_OPEN_NORMAL to always be sent
* to callbacks for the “open-location” signal.
- *
- * Since: 3.10
*/
void
gtk_places_sidebar_set_open_flags (GtkPlacesSidebar *sidebar,
}
}
-/**
+/*
* gtk_places_sidebar_get_open_flags:
* @sidebar: a #GtkPlacesSidebar
*
* Gets the open flags.
*
* Returns: the #GtkPlacesOpenFlags of @sidebar
- *
- * Since: 3.10
*/
GtkPlacesOpenFlags
gtk_places_sidebar_get_open_flags (GtkPlacesSidebar *sidebar)
return sidebar->open_flags;
}
-/**
+/*
* gtk_places_sidebar_set_location:
* @sidebar: a places sidebar
* @location: (nullable): location to select, or %NULL for no current path
* @sidebar will highlight that location if it is being shown in the list of
* places, or it will unhighlight everything if the @location is not among the
* places in the list.
- *
- * Since: 3.10
*/
void
gtk_places_sidebar_set_location (GtkPlacesSidebar *sidebar,
g_object_notify_by_pspec (G_OBJECT (sidebar), properties[PROP_LOCATION]);
}
-/**
+/*
* gtk_places_sidebar_get_location:
* @sidebar: a places sidebar
*
*
* Returns: (nullable) (transfer full): a #GFile with the selected location, or
* %NULL if nothing is visually selected.
- *
- * Since: 3.10
*/
GFile *
gtk_places_sidebar_get_location (GtkPlacesSidebar *sidebar)
return title;
}
-/**
+/*
* gtk_places_sidebar_set_show_recent:
* @sidebar: a places sidebar
* @show_recent: whether to show an item for recent files
* The default value for this option is determined by the desktop
* environment, but this function can be used to override it on a
* per-application basis.
- *
- * Since: 3.18
*/
void
gtk_places_sidebar_set_show_recent (GtkPlacesSidebar *sidebar,
}
}
-/**
+/*
* gtk_places_sidebar_get_show_recent:
* @sidebar: a places sidebar
*
* Returns the value previously set with gtk_places_sidebar_set_show_recent()
*
* Returns: %TRUE if the sidebar will display a builtin shortcut for recent files
- *
- * Since: 3.18
*/
gboolean
gtk_places_sidebar_get_show_recent (GtkPlacesSidebar *sidebar)
return sidebar->show_recent;
}
-/**
+/*
* gtk_places_sidebar_set_show_desktop:
* @sidebar: a places sidebar
* @show_desktop: whether to show an item for the Desktop folder
* The default value for this option is determined by the desktop
* environment and the user’s configuration, but this function can be
* used to override it on a per-application basis.
- *
- * Since: 3.10
*/
void
gtk_places_sidebar_set_show_desktop (GtkPlacesSidebar *sidebar,
}
}
-/**
+/*
* gtk_places_sidebar_get_show_desktop:
* @sidebar: a places sidebar
*
* Returns the value previously set with gtk_places_sidebar_set_show_desktop()
*
* Returns: %TRUE if the sidebar will display a builtin shortcut to the desktop folder.
- *
- * Since: 3.10
*/
gboolean
gtk_places_sidebar_get_show_desktop (GtkPlacesSidebar *sidebar)
return sidebar->show_desktop;
}
-/**
+/*
* gtk_places_sidebar_set_show_enter_location:
* @sidebar: a places sidebar
* @show_enter_location: whether to show an item to enter a location
*
* If you enable this, you should connect to the
* #GtkPlacesSidebar::show-enter-location signal.
- *
- * Since: 3.14
*/
void
gtk_places_sidebar_set_show_enter_location (GtkPlacesSidebar *sidebar,
}
}
-/**
+/*
* gtk_places_sidebar_get_show_enter_location:
* @sidebar: a places sidebar
*
* Returns the value previously set with gtk_places_sidebar_set_show_enter_location()
*
* Returns: %TRUE if the sidebar will display an “Enter Location” item.
- *
- * Since: 3.14
*/
gboolean
gtk_places_sidebar_get_show_enter_location (GtkPlacesSidebar *sidebar)
return sidebar->show_enter_location;
}
-/**
+/*
* gtk_places_sidebar_set_show_other_locations:
* @sidebar: a places sidebar
* @show_other_locations: whether to show an item for the Other Locations view
*
* If you enable this, you should connect to the
* #GtkPlacesSidebar::show-other-locations-with-flags signal.
- *
- * Since: 3.18
*/
void
gtk_places_sidebar_set_show_other_locations (GtkPlacesSidebar *sidebar,
}
}
-/**
+/*
* gtk_places_sidebar_get_show_other_locations:
* @sidebar: a places sidebar
*
* Returns the value previously set with gtk_places_sidebar_set_show_other_locations()
*
* Returns: %TRUE if the sidebar will display an “Other Locations” item.
- *
- * Since: 3.18
*/
gboolean
gtk_places_sidebar_get_show_other_locations (GtkPlacesSidebar *sidebar)
return sidebar->show_other_locations;
}
-/**
+/*
* gtk_places_sidebar_set_show_trash:
* @sidebar: a places sidebar
* @show_trash: whether to show an item for the Trash location
*
* Sets whether the @sidebar should show an item for the Trash location.
- *
- * Since: 3.18
*/
void
gtk_places_sidebar_set_show_trash (GtkPlacesSidebar *sidebar,
}
}
-/**
+/*
* gtk_places_sidebar_get_show_trash:
* @sidebar: a places sidebar
*
* Returns the value previously set with gtk_places_sidebar_set_show_trash()
*
* Returns: %TRUE if the sidebar will display a “Trash” item.
- *
- * Since: 3.18
*/
gboolean
gtk_places_sidebar_get_show_trash (GtkPlacesSidebar *sidebar)
return sidebar->show_trash;
}
-/**
+/*
* gtk_places_sidebar_set_local_only:
* @sidebar: a places sidebar
* @local_only: whether to show only local files
*
* Sets whether the @sidebar should only show local files.
- *
- * Since: 3.12
*/
void
gtk_places_sidebar_set_local_only (GtkPlacesSidebar *sidebar,
}
}
-/**
+/*
* gtk_places_sidebar_get_local_only:
* @sidebar: a places sidebar
*
* Returns the value previously set with gtk_places_sidebar_set_local_only().
*
* Returns: %TRUE if the sidebar will only show local files.
- *
- * Since: 3.12
*/
gboolean
gtk_places_sidebar_get_local_only (GtkPlacesSidebar *sidebar)
return NULL;
}
-/**
+/*
* gtk_places_sidebar_add_shortcut:
* @sidebar: a places sidebar
* @location: location to add as an application-specific shortcut
* across applications, and they are not persistent. If this function
* is called multiple times with different locations, then they are added
* to the sidebar’s list in the same order as the function is called.
- *
- * Since: 3.10
*/
void
gtk_places_sidebar_add_shortcut (GtkPlacesSidebar *sidebar,
update_places (sidebar);
}
-/**
+/*
* gtk_places_sidebar_remove_shortcut:
* @sidebar: a places sidebar
* @location: location to remove
* Removes an application-specific shortcut that has been previously been
* inserted with gtk_places_sidebar_add_shortcut(). If the @location is not a
* shortcut in the sidebar, then nothing is done.
- *
- * Since: 3.10
*/
void
gtk_places_sidebar_remove_shortcut (GtkPlacesSidebar *sidebar,
update_places (sidebar);
}
-/**
+/*
* gtk_places_sidebar_list_shortcuts:
* @sidebar: a places sidebar
*
* |[<!-- language="C" -->
* g_slist_free_full (list, (GDestroyNotify) g_object_unref);
* ]|
- *
- * Since: 3.10
*/
GSList *
gtk_places_sidebar_list_shortcuts (GtkPlacesSidebar *sidebar)
return g_slist_copy_deep (sidebar->shortcuts, (GCopyFunc) g_object_ref, NULL);
}
-/**
+/*
* gtk_places_sidebar_get_nth_bookmark:
* @sidebar: a places sidebar
* @n: index of the bookmark to query
* Returns: (nullable) (transfer full): The bookmark specified by the index @n, or
* %NULL if no such index exist. Note that the indices start at 0, even though
* the file chooser starts them with the keyboard shortcut "Alt-1".
- *
- * Since: 3.10
*/
GFile *
gtk_places_sidebar_get_nth_bookmark (GtkPlacesSidebar *sidebar,
return file;
}
-/**
+/*
* gtk_places_sidebar_set_drop_targets_visible:
* @sidebar: a places sidebar.
* @visible: whether to show the valid targets or not.
* that might target the sidebar. The drop-targets-visible state will be unset
* automatically if the drag finishes in the GtkPlacesSidebar. You only need
* to unset the state when the drag ends on some other widget on your application.
- *
- * Since: 3.18
*/
void
gtk_places_sidebar_set_drop_targets_visible (GtkPlacesSidebar *sidebar,
}
}
-/**
+/*
* gtk_places_sidebar_set_show_starred_location:
* @sidebar: a places sidebar
* @show_starred_location: whether to show an item for Starred files
*
* If you enable this, you should connect to the
* #GtkPlacesSidebar::show-starred-location signal.
- *
- * Since: 3.22.26
*/
void
gtk_places_sidebar_set_show_starred_location (GtkPlacesSidebar *sidebar,
}
}
-/**
+/*
* gtk_places_sidebar_get_show_starred_location:
* @sidebar: a places sidebar
*
* Returns the value previously set with gtk_places_sidebar_set_show_starred_location()
*
* Returns: %TRUE if the sidebar will display a Starred item.
- *
- * Since: 3.22.26
*/
gboolean
gtk_places_sidebar_get_show_starred_location (GtkPlacesSidebar *sidebar)
+++ /dev/null
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-
-/* GtkPlacesSidebar - sidebar widget for places in the filesystem
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * This code comes from Nautilus, GNOME’s file manager.
- *
- * Authors : Mr Jamie McCracken (jamiemcc at blueyonder dot co dot uk)
- * Federico Mena Quintero <federico@gnome.org>
- */
-
-#ifndef __GTK_PLACES_SIDEBAR_H__
-#define __GTK_PLACES_SIDEBAR_H__
-
-#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gtk/gtk.h> can be included directly."
-#endif
-
-#include <gtk/gtkwidget.h>
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_PLACES_SIDEBAR (gtk_places_sidebar_get_type ())
-#define GTK_PLACES_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PLACES_SIDEBAR, GtkPlacesSidebar))
-#define GTK_PLACES_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PLACES_SIDEBAR, GtkPlacesSidebarClass))
-#define GTK_IS_PLACES_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PLACES_SIDEBAR))
-#define GTK_IS_PLACES_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PLACES_SIDEBAR))
-#define GTK_PLACES_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PLACES_SIDEBAR, GtkPlacesSidebarClass))
-
-typedef struct _GtkPlacesSidebar GtkPlacesSidebar;
-typedef struct _GtkPlacesSidebarClass GtkPlacesSidebarClass;
-
-/**
- * GtkPlacesOpenFlags:
- * @GTK_PLACES_OPEN_NORMAL: This is the default mode that #GtkPlacesSidebar uses if no other flags
- * are specified. It indicates that the calling application should open the selected location
- * in the normal way, for example, in the folder view beside the sidebar.
- * @GTK_PLACES_OPEN_NEW_TAB: When passed to gtk_places_sidebar_set_open_flags(), this indicates
- * that the application can open folders selected from the sidebar in new tabs. This value
- * will be passed to the #GtkPlacesSidebar::open-location signal when the user selects
- * that a location be opened in a new tab instead of in the standard fashion.
- * @GTK_PLACES_OPEN_NEW_WINDOW: Similar to @GTK_PLACES_OPEN_NEW_TAB, but indicates that the application
- * can open folders in new windows.
- *
- * These flags serve two purposes. First, the application can call gtk_places_sidebar_set_open_flags()
- * using these flags as a bitmask. This tells the sidebar that the application is able to open
- * folders selected from the sidebar in various ways, for example, in new tabs or in new windows in
- * addition to the normal mode.
- *
- * Second, when one of these values gets passed back to the application in the
- * #GtkPlacesSidebar::open-location signal, it means that the application should
- * open the selected location in the normal way, in a new tab, or in a new
- * window. The sidebar takes care of determining the desired way to open the location,
- * based on the modifier keys that the user is pressing at the time the selection is made.
- *
- * If the application never calls gtk_places_sidebar_set_open_flags(), then the sidebar will only
- * use #GTK_PLACES_OPEN_NORMAL in the #GtkPlacesSidebar::open-location signal. This is the
- * default mode of operation.
- */
-typedef enum {
- GTK_PLACES_OPEN_NORMAL = 1 << 0,
- GTK_PLACES_OPEN_NEW_TAB = 1 << 1,
- GTK_PLACES_OPEN_NEW_WINDOW = 1 << 2
-} GtkPlacesOpenFlags;
-
-GDK_AVAILABLE_IN_3_10
-GType gtk_places_sidebar_get_type (void) G_GNUC_CONST;
-GDK_AVAILABLE_IN_3_10
-GtkWidget * gtk_places_sidebar_new (void);
-
-GDK_AVAILABLE_IN_3_10
-GtkPlacesOpenFlags gtk_places_sidebar_get_open_flags (GtkPlacesSidebar *sidebar);
-GDK_AVAILABLE_IN_3_10
-void gtk_places_sidebar_set_open_flags (GtkPlacesSidebar *sidebar,
- GtkPlacesOpenFlags flags);
-
-GDK_AVAILABLE_IN_3_10
-GFile * gtk_places_sidebar_get_location (GtkPlacesSidebar *sidebar);
-GDK_AVAILABLE_IN_3_10
-void gtk_places_sidebar_set_location (GtkPlacesSidebar *sidebar,
- GFile *location);
-
-GDK_AVAILABLE_IN_3_18
-gboolean gtk_places_sidebar_get_show_recent (GtkPlacesSidebar *sidebar);
-GDK_AVAILABLE_IN_3_18
-void gtk_places_sidebar_set_show_recent (GtkPlacesSidebar *sidebar,
- gboolean show_recent);
-
-GDK_AVAILABLE_IN_3_10
-gboolean gtk_places_sidebar_get_show_desktop (GtkPlacesSidebar *sidebar);
-GDK_AVAILABLE_IN_3_10
-void gtk_places_sidebar_set_show_desktop (GtkPlacesSidebar *sidebar,
- gboolean show_desktop);
-
-GDK_AVAILABLE_IN_3_14
-gboolean gtk_places_sidebar_get_show_enter_location (GtkPlacesSidebar *sidebar);
-GDK_AVAILABLE_IN_3_14
-void gtk_places_sidebar_set_show_enter_location (GtkPlacesSidebar *sidebar,
- gboolean show_enter_location);
-
-GDK_AVAILABLE_IN_3_12
-void gtk_places_sidebar_set_local_only (GtkPlacesSidebar *sidebar,
- gboolean local_only);
-GDK_AVAILABLE_IN_3_12
-gboolean gtk_places_sidebar_get_local_only (GtkPlacesSidebar *sidebar);
-
-
-GDK_AVAILABLE_IN_3_10
-void gtk_places_sidebar_add_shortcut (GtkPlacesSidebar *sidebar,
- GFile *location);
-GDK_AVAILABLE_IN_3_10
-void gtk_places_sidebar_remove_shortcut (GtkPlacesSidebar *sidebar,
- GFile *location);
-GDK_AVAILABLE_IN_3_10
-GSList * gtk_places_sidebar_list_shortcuts (GtkPlacesSidebar *sidebar);
-
-GDK_AVAILABLE_IN_3_10
-GFile * gtk_places_sidebar_get_nth_bookmark (GtkPlacesSidebar *sidebar,
- gint n);
-GDK_AVAILABLE_IN_3_18
-void gtk_places_sidebar_set_drop_targets_visible (GtkPlacesSidebar *sidebar,
- gboolean visible,
- GdkDragContext *context);
-GDK_AVAILABLE_IN_3_18
-gboolean gtk_places_sidebar_get_show_trash (GtkPlacesSidebar *sidebar);
-GDK_AVAILABLE_IN_3_18
-void gtk_places_sidebar_set_show_trash (GtkPlacesSidebar *sidebar,
- gboolean show_trash);
-
-GDK_AVAILABLE_IN_3_18
-void gtk_places_sidebar_set_show_other_locations (GtkPlacesSidebar *sidebar,
- gboolean show_other_locations);
-GDK_AVAILABLE_IN_3_18
-gboolean gtk_places_sidebar_get_show_other_locations (GtkPlacesSidebar *sidebar);
-
-GDK_AVAILABLE_IN_3_22
-void gtk_places_sidebar_set_show_starred_location (GtkPlacesSidebar *sidebar,
- gboolean show_starred_location);
-GDK_AVAILABLE_IN_3_22
-gboolean gtk_places_sidebar_get_show_starred_location (GtkPlacesSidebar *sidebar);
-G_END_DECLS
-
-#endif /* __GTK_PLACES_SIDEBAR_H__ */
#define __GTK_PLACES_SIDEBAR_PRIVATE_H__
#include <glib.h>
-#include "gtkplacessidebar.h"
+#include <gtk/gtkwidget.h>
+#include <gtk/gtkenums.h>
G_BEGIN_DECLS
+#define GTK_TYPE_PLACES_SIDEBAR (gtk_places_sidebar_get_type ())
+#define GTK_PLACES_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PLACES_SIDEBAR, GtkPlacesSidebar))
+#define GTK_PLACES_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PLACES_SIDEBAR, GtkPlacesSidebarClass))
+#define GTK_IS_PLACES_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PLACES_SIDEBAR))
+#define GTK_IS_PLACES_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PLACES_SIDEBAR))
+#define GTK_PLACES_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PLACES_SIDEBAR, GtkPlacesSidebarClass))
+
+typedef struct _GtkPlacesSidebar GtkPlacesSidebar;
+typedef struct _GtkPlacesSidebarClass GtkPlacesSidebarClass;
+
+/*
+ * GtkPlacesOpenFlags:
+ * @GTK_PLACES_OPEN_NORMAL: This is the default mode that #GtkPlacesSidebar uses if no other flags
+ * are specified. It indicates that the calling application should open the selected location
+ * in the normal way, for example, in the folder view beside the sidebar.
+ * @GTK_PLACES_OPEN_NEW_TAB: When passed to gtk_places_sidebar_set_open_flags(), this indicates
+ * that the application can open folders selected from the sidebar in new tabs. This value
+ * will be passed to the #GtkPlacesSidebar::open-location signal when the user selects
+ * that a location be opened in a new tab instead of in the standard fashion.
+ * @GTK_PLACES_OPEN_NEW_WINDOW: Similar to @GTK_PLACES_OPEN_NEW_TAB, but indicates that the application
+ * can open folders in new windows.
+ *
+ * These flags serve two purposes. First, the application can call gtk_places_sidebar_set_open_flags()
+ * using these flags as a bitmask. This tells the sidebar that the application is able to open
+ * folders selected from the sidebar in various ways, for example, in new tabs or in new windows in
+ * addition to the normal mode.
+ *
+ * Second, when one of these values gets passed back to the application in the
+ * #GtkPlacesSidebar::open-location signal, it means that the application should
+ * open the selected location in the normal way, in a new tab, or in a new
+ * window. The sidebar takes care of determining the desired way to open the location,
+ * based on the modifier keys that the user is pressing at the time the selection is made.
+ *
+ * If the application never calls gtk_places_sidebar_set_open_flags(), then the sidebar will only
+ * use #GTK_PLACES_OPEN_NORMAL in the #GtkPlacesSidebar::open-location signal. This is the
+ * default mode of operation.
+ */
+
+GType gtk_places_sidebar_get_type (void) G_GNUC_CONST;
+GtkWidget * gtk_places_sidebar_new (void);
+
+GtkPlacesOpenFlags gtk_places_sidebar_get_open_flags (GtkPlacesSidebar *sidebar);
+void gtk_places_sidebar_set_open_flags (GtkPlacesSidebar *sidebar,
+ GtkPlacesOpenFlags flags);
+
+GFile * gtk_places_sidebar_get_location (GtkPlacesSidebar *sidebar);
+void gtk_places_sidebar_set_location (GtkPlacesSidebar *sidebar,
+ GFile *location);
+
+gboolean gtk_places_sidebar_get_show_recent (GtkPlacesSidebar *sidebar);
+void gtk_places_sidebar_set_show_recent (GtkPlacesSidebar *sidebar,
+ gboolean show_recent);
+
+gboolean gtk_places_sidebar_get_show_desktop (GtkPlacesSidebar *sidebar);
+void gtk_places_sidebar_set_show_desktop (GtkPlacesSidebar *sidebar,
+ gboolean show_desktop);
+
+gboolean gtk_places_sidebar_get_show_enter_location (GtkPlacesSidebar *sidebar);
+void gtk_places_sidebar_set_show_enter_location (GtkPlacesSidebar *sidebar,
+ gboolean show_enter_location);
+
+void gtk_places_sidebar_set_local_only (GtkPlacesSidebar *sidebar,
+ gboolean local_only);
+gboolean gtk_places_sidebar_get_local_only (GtkPlacesSidebar *sidebar);
+
+
+void gtk_places_sidebar_add_shortcut (GtkPlacesSidebar *sidebar,
+ GFile *location);
+void gtk_places_sidebar_remove_shortcut (GtkPlacesSidebar *sidebar,
+ GFile *location);
+GSList * gtk_places_sidebar_list_shortcuts (GtkPlacesSidebar *sidebar);
+
+GFile * gtk_places_sidebar_get_nth_bookmark (GtkPlacesSidebar *sidebar,
+ gint n);
+void gtk_places_sidebar_set_drop_targets_visible (GtkPlacesSidebar *sidebar,
+ gboolean visible,
+ GdkDragContext *context);
+gboolean gtk_places_sidebar_get_show_trash (GtkPlacesSidebar *sidebar);
+void gtk_places_sidebar_set_show_trash (GtkPlacesSidebar *sidebar,
+ gboolean show_trash);
+
+void gtk_places_sidebar_set_show_other_locations (GtkPlacesSidebar *sidebar,
+ gboolean show_other_locations);
+gboolean gtk_places_sidebar_get_show_other_locations (GtkPlacesSidebar *sidebar);
+
+void gtk_places_sidebar_set_show_starred_location (GtkPlacesSidebar *sidebar,
+ gboolean show_starred_location);
+gboolean gtk_places_sidebar_get_show_starred_location (GtkPlacesSidebar *sidebar);
+
/* Keep order, since it's used for the sort functions */
typedef enum {
SECTION_INVALID,